<%@ page language="java" import="com.alibaba.fastjson.JSONObject" pageEncoding="UTF-8" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.general.Util" %>
<%--计算考试得分--%>
<%
    JSONObject jsonData = new JSONObject();
    RecordSet rs = new RecordSet();
    BaseBean bb = new BaseBean();
    String formtable = "formtable_main_286";
    String requestid = Util.null2String(request.getParameter("requestid"));
    bb.writeLog(">>>>>getKsdf_Ajax>>>>requestid="+requestid);
    String mainid = getFieldValByname("id", requestid, formtable);
    bb.writeLog(">>>>>getKsdf_Ajax>>>>mainid="+mainid);
    rs.executeQuery("select sum(isnull(df,0)) from view_custom_ksdf where mainid="+mainid);
    rs.next();
    String df = Util.null2String(rs.getString(1));
    bb.writeLog(">>>>>getKsdf_Ajax>>>>df="+df);
    rs.executeUpdate("update "+formtable+" set sjdf='"+df+"' where id=?",mainid);
    rs.executeUpdate("update uf_kstjtz_dt1 set sjdf='"+df+"' where sjxq=?",requestid);
    jsonData.put( "flag", true );
    out.print( jsonData.toJSONString() );
%>
<%!
    /**
     * 获取表单字段
     */
    public String getFieldValByname(String filename, String requestid, String formtable) {
        RecordSet rs = new RecordSet();
        rs.executeQuery("select " + filename + " from " + formtable + " where requestid=?", requestid);
        rs.next();
        return Util.null2String(rs.getString(1));
    }
%>





